home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / GXEnvironment.p < prev    next >
Text File  |  1996-05-01  |  7KB  |  220 lines

  1. {
  2.      File:        GXEnvironment.p
  3.  
  4.      Contains:    QuickDraw GX environment constants and interfaces
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT GXEnvironment;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __GXENVIRONMENT__}
  28. {$SETC __GXENVIRONMENT__ := 1}
  29.  
  30. {$I+}
  31. {$SETC GXEnvironmentIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __CONDITIONALMACROS__}
  35. {$I ConditionalMacros.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __WINDOWS__}
  41. {$I Windows.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __GXTYPES__}
  44. {$I GXTypes.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __CMAPPLICATION__}
  47. {$I CMApplication.p}
  48. {$ENDC}
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  55.  
  56. CONST
  57.     defaultPollingHandlerFlags    = $00;
  58.     okToSwitchDuringPollFlag    = $00;
  59.     dontSwitchDuringPollFlag    = $01;
  60.  
  61.  
  62. TYPE
  63.     gxPollingHandlerFlags                = LONGINT;
  64.     gxPollingHandlerProcPtr = ProcPtr;  { PROCEDURE gxPollingHandler(reference: LONGINT; flags: gxPollingHandlerFlags); C; }
  65.  
  66.     gxPollingHandlerUPP = UniversalProcPtr;
  67.  
  68. CONST
  69.     uppgxPollingHandlerProcInfo = $000003C1;
  70.  
  71. FUNCTION NewgxPollingHandlerProc(userRoutine: gxPollingHandlerProcPtr): gxPollingHandlerUPP;
  72.     {$IFC NOT GENERATINGCFM }
  73.     INLINE $2E9F;
  74.     {$ENDC}
  75.  
  76. PROCEDURE CallgxPollingHandlerProc(reference: LONGINT; flags: gxPollingHandlerFlags; userRoutine: gxPollingHandlerUPP);
  77.     {$IFC NOT GENERATINGCFM}
  78.     {To be implemented:  Glue to move parameters into registers.}
  79.     {$ENDC}
  80. FUNCTION GXGetGraphicsPollingHandler(VAR reference: LONGINT): gxPollingHandlerUPP; C;
  81. PROCEDURE GXSetGraphicsPollingHandler(handler: gxPollingHandlerUPP; reference: LONGINT); C;
  82. {  QD to QD GX Translator typedefs  }
  83.  
  84. CONST
  85.     gxDefaultOptionsTranslation    = $0000;
  86.     gxOptimizedTranslation        = $0001;
  87.     gxReplaceLineWidthTranslation = $0002;
  88.     gxSimpleScalingTranslation    = $0004;
  89.     gxSimpleGeometryTranslation    = $0008;                        {  implies simple scaling  }
  90.     gxSimpleLinesTranslation    = $000C;                        {  implies simple geometry & scaling  }
  91.     gxLayoutTextTranslation        = $0010;                        {  turn on gxLine layout (normally off)  }
  92.     gxRasterTargetTranslation    = $0020;
  93.     gxPostScriptTargetTranslation = $0040;
  94.     gxVectorTargetTranslation    = $0080;
  95.     gxPDDTargetTranslation        = $0100;
  96.     gxDontConvertPatternsTranslation = $1000;
  97.  
  98.  
  99. TYPE
  100.     gxTranslationOption                    = LONGINT;
  101.  
  102. CONST
  103.     gxContainsFormsBegin        = $0001;
  104.     gxContainsFormsEnd            = $0002;
  105.     gxContainsPostScript        = $0004;
  106.     gxContainsEmptyPostScript    = $0008;
  107.  
  108.  
  109. TYPE
  110.     gxTranslationStatistic                = LONGINT;
  111.  
  112. CONST
  113.     gxQuickDrawPictTag            = 'pict';
  114.  
  115.  
  116. TYPE
  117.     gxQuickDrawPictPtr = ^gxQuickDrawPict;
  118.     gxQuickDrawPict = RECORD
  119.                                                                         {  translator inputs  }
  120.         options:                gxTranslationOption;
  121.         srcRect:                Rect;
  122.         styleStretch:            Point;
  123.                                                                         {  size of quickdraw picture data  }
  124.         dataLength:                LONGINT;
  125.                                                                         {  file alias  }
  126.         alias:                    gxBitmapDataSourceAlias;
  127.     END;
  128.  
  129. {  WindowRecord utilities  }
  130. FUNCTION GXNewWindowViewPort(qdWindow: WindowRef): gxViewPort; C;
  131. FUNCTION GXGetWindowViewPort(qdWindow: WindowRef): gxViewPort; C;
  132. FUNCTION GXGetViewPortWindow(portOrder: gxViewPort): WindowRef; C;
  133. {  GDevice utilities  }
  134. FUNCTION GXGetViewDeviceGDevice(theDevice: gxViewDevice): GDHandle; C;
  135. FUNCTION GXGetGDeviceViewDevice(qdGDevice: GDHandle): gxViewDevice; C;
  136. {  gxPoint utilities  }
  137. PROCEDURE GXConvertQDPoint({CONST}VAR shortPt: Point; portOrder: gxViewPort; VAR fixedPt: gxPoint); C;
  138.  
  139. TYPE
  140.     gxShapeSpoolProcPtr = ProcPtr;  { FUNCTION gxShapeSpool(toSpool: gxShape; refCon: LONGINT): OSErr; C; }
  141.  
  142. {  printing utilities typedef  }
  143.     gxUserViewPortFilterProcPtr = ProcPtr;  { PROCEDURE gxUserViewPortFilter(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT); C; }
  144.  
  145.     gxConvertQDFontProcPtr = ProcPtr;  { FUNCTION gxConvertQDFont(dst: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C; }
  146.  
  147.     gxShapeSpoolUPP = UniversalProcPtr;
  148.     gxUserViewPortFilterUPP = UniversalProcPtr;
  149.     gxConvertQDFontUPP = UniversalProcPtr;
  150.  
  151. CONST
  152.     uppgxShapeSpoolProcInfo = $000003E1;
  153.     uppgxUserViewPortFilterProcInfo = $00000FC1;
  154.     uppgxConvertQDFontProcInfo = $00000FF1;
  155.  
  156. FUNCTION NewgxShapeSpoolProc(userRoutine: gxShapeSpoolProcPtr): gxShapeSpoolUPP;
  157.     {$IFC NOT GENERATINGCFM }
  158.     INLINE $2E9F;
  159.     {$ENDC}
  160.  
  161. FUNCTION NewgxUserViewPortFilterProc(userRoutine: gxUserViewPortFilterProcPtr): gxUserViewPortFilterUPP;
  162.     {$IFC NOT GENERATINGCFM }
  163.     INLINE $2E9F;
  164.     {$ENDC}
  165.  
  166. FUNCTION NewgxConvertQDFontProc(userRoutine: gxConvertQDFontProcPtr): gxConvertQDFontUPP;
  167.     {$IFC NOT GENERATINGCFM }
  168.     INLINE $2E9F;
  169.     {$ENDC}
  170.  
  171. FUNCTION CallgxShapeSpoolProc(toSpool: gxShape; refCon: LONGINT; userRoutine: gxShapeSpoolUPP): OSErr;
  172.     {$IFC NOT GENERATINGCFM}
  173.     {To be implemented:  Glue to move parameters into registers.}
  174.     {$ENDC}
  175.  
  176. PROCEDURE CallgxUserViewPortFilterProc(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT; userRoutine: gxUserViewPortFilterUPP);
  177.     {$IFC NOT GENERATINGCFM}
  178.     {To be implemented:  Glue to move parameters into registers.}
  179.     {$ENDC}
  180.  
  181. FUNCTION CallgxConvertQDFontProc(dst: gxStyle; txFont: LONGINT; txFace: LONGINT; userRoutine: gxConvertQDFontUPP): LONGINT;
  182.     {$IFC NOT GENERATINGCFM}
  183.     {To be implemented:  Glue to move parameters into registers.}
  184.     {$ENDC}
  185.  
  186. TYPE
  187.     gxShapeSpoolFunction                = gxShapeSpoolProcPtr;
  188.     gxUserViewPortFilter                = gxUserViewPortFilterProcPtr;
  189.     gxConvertQDFontFunction                = gxConvertQDFontProcPtr;
  190. {  mouse utilities  }
  191. {  return mouse location in fixed-gxPoint global space  }
  192. PROCEDURE GXGetGlobalMouse(VAR globalPt: gxPoint); C;
  193. {  return fixed-gxPoint local mouse (gxViewPort == 0 --> default)  }
  194. PROCEDURE GXGetViewPortMouse(portOrder: gxViewPort; VAR localPt: gxPoint); C;
  195. {  printing utilities  }
  196. FUNCTION GXGetViewPortFilter(portOrder: gxViewPort; VAR refCon: LONGINT): gxUserViewPortFilterUPP; C;
  197. PROCEDURE GXSetViewPortFilter(portOrder: gxViewPort; filter: gxUserViewPortFilterUPP; refCon: LONGINT); C;
  198. {  QD to QD GX Translator functions  }
  199. PROCEDURE GXInstallQDTranslator(port: GrafPtr; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStrech: Point; userFunction: gxShapeSpoolUPP; reference: UNIV Ptr); C;
  200. FUNCTION GXRemoveQDTranslator(port: GrafPtr; VAR statistic: gxTranslationStatistic): gxTranslationStatistic; C;
  201. FUNCTION GXConvertPICTToShape(pict: PicHandle; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStretch: Point; destination: gxShape; VAR stats: gxTranslationStatistic): gxShape; C;
  202. {  Find the best GX style given a QD font and face. Called by the QD->GX translator  }
  203. FUNCTION GXConvertQDFont(theStyle: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C;
  204. FUNCTION GXGetConvertQDFont: gxConvertQDFontUPP; C;
  205. PROCEDURE GXSetConvertQDFont(userFunction: gxConvertQDFontUPP); C;
  206. {  ColorSync 2.0 interface related routines  }
  207. PROCEDURE GXSetColorProfileReference(profile: gxColorProfile; reference: CMProfileRef); C;
  208. FUNCTION GXGetColorProfileReference(profile: gxColorProfile): CMProfileRef; C;
  209. {$ENDC}
  210. {$ALIGN RESET}
  211. {$POP}
  212.  
  213. {$SETC UsingIncludes := GXEnvironmentIncludes}
  214.  
  215. {$ENDC} {__GXENVIRONMENT__}
  216.  
  217. {$IFC NOT UsingIncludes}
  218.  END.
  219. {$ENDC}
  220.